/**
 * 
 */
package command;

/**
 * PatternBox: "Invoker" implementation.
 * <ul>
 *   <li>asks the command to carry out the request.</li>
 * </ul>
 * 
 * @author <a href="mailto:dirk.ehms@patternbox.com">Dirk Ehms</a>
 * @author lx
 */
public class Invoker {

	/** stores the Command instance of the Invoker */
	private Command fCommand;

	/** 
	 * Default constructor
	 */
	public Invoker() {
		super();
	}

	/** 
	 * Constructor
	 */
	public Invoker(Command cmd) {
		super();
		fCommand = cmd;
	}

	/** 
	 * This method stores a ConcreteCommand instance.
	 */
	public void storeCommand(Command cmd) {
		fCommand = cmd;
	}

	/** 
	 * This method performs the actions associated with the ConcreteCommand
	 * instance.
	 */
	public void execute() {
		fCommand.execute();
	}

}
